<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<div th:fragment="leftmenus">
	<div style="position: relative; margin-top: 20px;">
		<input type="text" placeholder="查找..." class="search-input cha" />
		<span style="display: inline-block; height: 35px; width: 38px; background: red; position: absolute; text-align: center; line-height: 35px; border-bottom-right-radius: 2px; border-top-right-radius: 2px; background: #374850;">
			<a href="#" class="chazhao">
				<span class="glyphicon glyphicon-search" style="color: white;"></span>
			</a>
		</span>
	</div>
	<div class="panel-group" id="accordion" style="margin-top: 10px; margin-left: -12px;">
		<th:block th:unless="${#lists.isEmpty(menus)}" >
		<div class="panel panel-default" th:each="menu,iterStat : ${menus}">
			<div class="panel-heading" th:if="${menu.parentId == 0}">
				<a class="open-menu green-left" th:href="@{'#collapse'+${menu.menuId}}" data-toggle="collapse" data-parent="#accordion">
					<span class="glyphicon" th:classappend="${menu.menuIcon}"></span>
					<span th:text="${menu.menuName}">UI 元素</span>
					<span class="glyphicon glyphicon-menu-left pull-right"></span>
				</a>
			</div>
			<div th:id="collapse+${menu.menuId}" class="panel-collapse collapse ">
				<ul th:each="submenu,iterStat2 : ${menus}" th:if="${submenu.parentId == menu.menuId}">
					<li >
						<a th:href="@{${submenu.menuUrl}}" target="content">
							<span class="glyphicon" th:classappend="${submenu.menuIcon}"></span>
							<span th:text="${submenu.menuName}" >UI 元素</span>
						</a>
					</li>
			</ul>
			</div>
			</div>
		</th:block>
	</div>
	<script>
		$(function(){
			$(".chazhao").click(function(){
				var $val=$(".cha").val();
				$(".thistable").load("menucha",{val:$val});
			});
		})
	</script>
</div>
</html>